package day15.LX;

import java.io.IOException;
import java.net.*;

public class Lian02 {
    public static void main(String[] args) throws IOException {
//        创建一个码头
        DatagramSocket ds = new DatagramSocket();
        String s = "我是谁,我在哪";
        byte[] bytes = s.getBytes();
        InetAddress address = InetAddress.getByName("127.0.0.1");
        int port = 10000;
        DatagramPacket dp = new DatagramPacket(bytes, bytes.length, address, port);
//       用码头传递
        ds.send(dp);
        ds.close();

    }
}
